package com.googlecode.horncomb.orm.ibatis;

import java.util.Collection;
import java.util.List;

import com.googlecode.horncomb.bean.order.Order;
import com.googlecode.horncomb.bean.paged.PagedList;
import com.googlecode.horncomb.orm.dao.CommonEntityBaseDao;
import com.googlecode.horncomb.orm.dao.CommonEntityQueryDao;

/**
 * SqlMap Enitity DAO Interfaces
 * @author Daniel
 */
@SuppressWarnings("unchecked")
public interface CommonSqlMapEntityDao extends CommonEntityBaseDao, CommonEntityQueryDao {

	/**
	 * query by a instance
	 * @param example
	 *            the instance
	 * @param order
	 *            result order
	 * @param page
	 *            the number of result
	 * @param pageSize
	 *            the size in one page
	 * @return the paged list of result
	 */
	public PagedList queryByExample(Object example, Order order, int page,
			int pageSize);

	/**
	 * query count by a instance
	 * @param example
	 *            the instance for query
	 * @return the count of result
	 */
	public int queryCountByExample(Object example);

	/**
	 * query by a instance, not paed
	 * @param example
	 *            the instance for query
	 * @return the collection of result object
	 */
	public Collection queryByExample(Object example);

	/**
	 * query by a instance, not paed
	 * @param example
	 *            the instance for query
	 * @param order
	 *            result order
	 * @return the list of result object
	 */
	public List queryByExample(Object example, Order order);

	/**
	 * @param entityClass
	 */
	public void setEntityClass(Class<?> entityClass);

	/**
	 * set namespace of sqlmap
	 * @param namespace
	 *            the namespace of sqlmap
	 */
	public void setNamespace(String namespace);
}
